package com.yuji.aacar.controller.order.orderstatus;

import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

import com.yuji.aacar.R;
import com.yuji.aacar.base.BaseActivity;
import com.yuji.aacar.widgets.autolayout.AutoRelativeLayout;
import com.yuji.aacar.widgets.countdownview.CountDownView;
import com.yuji.aacar.widgets.textview.PingFangTextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * <li>Package:com.yuji.aacar.controller.order.orderstatus</li>
 * <li>Author: lining </li>
 * <li>Date: 2018/3/8</li>
 * <li>Description:   </li>
 */

public class WaitForOrderConfirmActivity extends BaseActivity {


    @BindView(R.id.title_back)
    ImageView titleBack;
    @BindView(R.id.back_image)
    AutoRelativeLayout backImage;
    @BindView(R.id.title_content)
    PingFangTextView titleContent;
    @BindView(R.id.back_login)
    PingFangTextView backLogin;
    @BindView(R.id.title_message_iv)
    ImageView titleMessageIv;
    @BindView(R.id.title_message_rl)
    AutoRelativeLayout titleMessageRl;
    @BindView(R.id.title_rl)
    AutoRelativeLayout titleRl;
    @BindView(R.id.countdowntv)
    CountDownView countdowntv;
    @BindView(R.id.wait_for_confirm_time_layout)
    AutoRelativeLayout waitForConfirmTimeLayout;
    @BindView(R.id.wait_for_confirm_tv1)
    PingFangTextView waitForConfirmTv1;
    @BindView(R.id.wait_for_confirm_cancel_btn)
    Button waitForConfirmCancelBtn;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_wait_for_confirm);
        ButterKnife.bind(this);
        initTitle(true, "订单支付", null);
        super.onCreate(savedInstanceState);


        countdowntv.setCountdownTime(15 * 60);
        countdowntv.startCountDown();
        countdowntv.setAddCountDownListener(new CountDownView.OnCountDownFinishListener() {
            @Override
            public void countDownFinished() {
                Toast.makeText(WaitForOrderConfirmActivity.this, "倒计时结束", Toast.LENGTH_SHORT).show();
            }
        });

        //        countdowntv.setOnClickListener(new View.OnClickListener() {
        //            @Override
        //            public void onClick(View v) {
        //                countdowntv.startCountDown();
        //            }
        //        });
    }

    @OnClick(R.id.wait_for_confirm_cancel_btn)
    public void onClick() {
        presentController(OrderFailActivity.class);
    }


}
